home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-03-22 | 1.5 KB | 72 lines |
- ' Freely distrubutable << (I know its spelt wrong but im very hap-hazzard)
- ' as long as NO profit is made from this proggy...
- '
- ' A simulated REMOTE-SHELL using AMOS
- '
- ' Copyright 1991, M. R. N. ARNOLD
- ' To contact me,
- ' Write to 'Stephen Arnold' on either 071 for amiga or Cheam Amiga
- '
- ' Please note that this program has been literally thrown together and it
- ' does not represent good programming practice at all!, But for something
- ' so short i dont really care. Structure only becomes important on long
- ' programs, However if you dont know how to structure programming then its
- ' a good idea to try and do it, even on short ones, this proggy is a bodge!
- '
- ' Remote Shell Routine!
- '
- Reserve As Work 14,200
- Screen Open 0,640,200,2,Hires
- Paper 0 : Pen 1 : Cls : Colour 1,$CCC : ER=0
- Curs On
- Global ER
- Request Off
- Dir$="rad:"
- '
- '
- '
- For F=1 To 20 : Print : Next F
- BEGIN:
- On Error Goto 0
- Print
- Line Input "1>";A$
- If A$="" Then Goto BEGIN
- A$=Upper$(A$)
- R=0
- If Mid$(A$,1,4)="RUN " Then R=1 : A$=Mid$(A$,5)
- A=1
- X1:
- If Mid$(A$,A,1)=" " Then Inc A : Goto X1
- A$=Mid$(A$,A)
- A=Instr(A$," ")
- X$=A$+" >pipe:DosXShell"
- If A<>0 Then X$=Mid$(A$,1,A)+">pipe:DosXShell "+Mid$(A$,(A+1))
- '
- If R=1 Then X$="RUN "+X$
- A=Start(14)
- For F=1 To Len(X$)
- Poke A,Asc(Mid$(X$,F,1))
- Inc A
- Next F
- Poke A,0
- Dreg(4)=Start(14)
- Call 15
- '
- Global ER
- Open In 1,"pipe:DosXShell"
- '
- On Error Proc X
- Do
- XX:
- A$=Input$(1,1)
- If ER=1 Then Exit
- If A$=Chr$(10) Then A$=Chr$(10)+Chr$(13)
- Print A$;
- Loop
- Close 1
- ER=0
- Goto BEGIN
- Procedure X
- ER=1
- Resume Next
- End Proc